package YAPserver.gameObjects;

import YAPenvironment.YAPconstant.SideState;
import YAPserver.behaviours.BounceMirror;
/**
 * The wall is essentially a line with a bounceBehaviour. The walls are used to define the field in which gamePlay takes place.
 * @author Daniel
 *
 */
public class GameWall extends AbstractWall{
	//default wall reflects the ball like a mirror
	//might put this boolean in the abstract wall constructor
	private GameWall m_prev;
	private GameWall m_next;
	private SideState m_wallColour;
//	private WallColour m_wallColour;
	
	/**
	 * Constructs a wall using two points.
	 * @param startPoint point used to construct this wall
	 * @param endPoint point used to construct this wall
	 */
	public GameWall(Point startPoint, Point endPoint){
		super(startPoint, endPoint);
		m_wallColour = SideState.wall;
		m_bounceBehaviour = new BounceMirror();
	}
	
	/**
	 * Sets the colour of this wall.
	 * @param colour colour this wall should be
	 * @see SideState
	 */
	public void setColour(SideState colour){
		m_wallColour = colour;
	}

	@Override
	public void setMiddlePoint(Point point) {
		// DO NOTHING
		// can't reset a walls middlePoint once instantiated
	}
	/**
	 * Sets the previous wall. (The wall to the right of this wall).
	 * @param prev wall that will be linked to this wall
	 */
	public void setPrevWall(GameWall prev){
		m_prev = prev;
	}
	/**
	 * Sets the next wall. (The wall to the left of this wall).
	 * @param next wall that will be linked to this wall
	 */
	public void setNextWall(GameWall next){
		m_next = next;
	}
	/**
	 * Returns the wall to the right of this wall.
	 * @return the previous wall
	 */
	public GameWall getPrevWall(){
		return m_prev;
	}
	/**
	 * Returns the wall to the left of this wall.
	 * @return the next wall
	 */
	public GameWall getNextWall(){
		return m_next;
	}
	/**
	 * Returns the colour of this wall as a string.
	 * @return the colour of this wall
	 */
	public String stringColour(){
		String s = "";
		s = s + m_wallColour.getValue();
		return s;
	}

}
